/*
 * @Author: your name
 * @Date: 2020-06-04 15:41:24
 * @LastEditTime: 2020-06-04 16:08:58
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \mobile_project_200106\mobile_project\src\store\modules\getbadge.js
 */ 
let badgeModule={
    namespaced:true,
    state:{
        list:JSON.parse(localStorage.getItem("goodsList")) || []
    },
    getters:{
        getBadge(state) {//获取显示的徽标
            let sum = 0;
            state.list.forEach(item => {
              sum += item.num;
            });
            return sum;
          }
    }
}
export default badgeModule